import shopApi from '../../service/shop.service'

const app = getApp()

Page({

  data: {
    shop:[]
  },

  onLoad() {
    this.getShop()
  },

  getShop() {
    const self = this;
    let success = function (res) {
      self.setData({shop:res.data.result.datas})
    }

    let fail = function (msg) {
      dd.showToast({
          type: 'fail',
          content: msg
      })
    }
    
    shopApi.shop({}, success, fail);
  },

onCardClick(ev) {
   my.alert({
     content: ev.info,
   });
 },
 onActionClick() {
   my.alert({
     content: 'action clicked',
   });
 },
 onExtraActionClick() {
   my.alert({
     content: 'extra action clicked',
   });
 },
 toggle() {
   this.setData({
     expand3rd: !this.data.expand3rd,
   });
 }
})

